//
//  HMNewGuideCollectionViewCell.m
//  新特性
//
//  Created by mac on 17/1/5.
//  Copyright © 2017年 mac.gu. All rights reserved.
//

#import "HMNewGuideCollectionViewCell.h"

@interface HMNewGuideCollectionViewCell ()

@property (nonatomic, strong) UIImageView *imageView;
@end


@implementation HMNewGuideCollectionViewCell

//懒加载
- (UIImageView *)imageView
{
    if (_imageView == nil)
    {
        _imageView = [[UIImageView alloc] init];
        
        _imageView.frame = [UIScreen mainScreen].bounds;
        
        
        [self addSubview:_imageView];
    }
    
    return _imageView;
}

- (void)setImageBg:(UIImage *)imageBg
{
    _imageBg = imageBg;
    
    self.imageView.image = imageBg;
}










- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // 添加子控件
        [self setupUI];
    }
    return self;
}

- (void)setupUI {
    
    
    self.imageView.image = [UIImage imageNamed:@"launch_default_image_4s_3"];
    self.imageView.frame = [UIScreen mainScreen].bounds;
    [self.contentView addSubview:self.imageView];
    
}

- (void)setIndexPath:(NSIndexPath *)indexPath {
    _indexPath = indexPath;
    

    NSString *imageName = [NSString stringWithFormat:@"launch_default_image_4s_%@",@(indexPath.item + 1)];
    
    self.imageView.image = [UIImage imageNamed:imageName];
    
}


@end
